/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.skatiger.jrove.compiler;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.el.ValueExpression;

import org.skatiger.jrove.component.UIComponent;
import org.skatiger.jrove.component.UIComponentBase;

class UILeaf extends UIComponentBase {

    private final static Map<String, UIComponent> facets = new HashMap<String, UIComponent>() {
        /**
         * 
         */
        private static final long serialVersionUID = 2823513754388546388L;

        @Override
        public UIComponent put(String name, UIComponent value) {
            return null;
        }

        @Override
        public void putAll(Map<? extends String, ? extends UIComponent> map) {
            // do nothing
        }
    };

    private UIComponent parent;

    public UIComponent findComponent(String id) {
        return null;
    }

    @Override
    public int getChildCount() {
        return 0;
    }

    @Override
    public List<UIComponent> getChildren() {
        return Collections.emptyList();
    }

    @Override
    public UIComponent getFacet(String name) {
        return null;
    }

    @Override
    public int getFacetCount() {
        return 0;
    }

    @Override
    public Map<String, UIComponent> getFacets() {
        return facets;
    }

    @Override
    public Iterator<UIComponent> getFacetsAndChildren() {
        Collection<UIComponent> collection = Collections.emptyList();
        return collection.iterator();
    }

    @Override
    public UIComponent getParent() {
        return this.parent;
    }

    @Override
    public ValueExpression getValueExpression(String name) {
        return null;
    }

    @Override
    public boolean isRendered() {
        return true;
    }

    @Override
    public void setParent(UIComponent parent) {
        this.parent = parent;
    }

    @Override
    public void setRendered(boolean rendered) {
        // do nothing
    }

    @Override
    public void setValueExpression(String name, ValueExpression ve) {
        // do nothing
    }

}
